// @Bind @dtOperation.onInsert
!function(self, arg) {

var loginUsername = "${loginUsername}";

var operation = arg.entity;

operation.set("creatorUid", loginUsername);


}

// @Bind view.onReady
!function(self, arg) {
routingUid = '${request.getParameter("routingUid")}';
var dsOperation = view.id("dsOperation");
dsOperation.set("parameter", {routingUid: routingUid});
dsOperation.flush();

}

// @Bind #updateActionSave.beforeExecute
!function(self, arg) {
self.set("parameter",{routingUid:routingUid});
}

// @Bind #updateActionSave.onSuccess
!function(self, arg) {
view.id("dsOperation").flush();

}

// @Bind #dpOperationType.beforeExecute
!function(self,arg,dsTypesData) {
dsTypesData.set("parameter", {typeName:"tasktype"});
dsTypesData.flush();
}

// @Bind #dpOperationType.onValueSelect
!function(self,arg,dsOperation,dsTypesData) {
var operation = dsOperation.getData('#');
var typesData = dsTypesData.getData('#');

operation.set("operationType",typesData.get("typeId"));

operation.set("operationTypeDesc",typesData.get("idDescription"));

}

// @Bind #dpOpType.beforeExecute
!function(self,arg,dsTypesData) {
dsTypesData.set("parameter", {typeName:"optype"});
dsTypesData.flush();
}

// @Bind #dpOpType.onValueSelect
!function(self,arg,dsOperation,dsTypesData) {
var operation = dsOperation.getData('#');
var typesData = dsTypesData.getData('#');

operation.set("opType",typesData.get("typeId"));

operation.set("opTypeDesc",typesData.get("idDescription"));

}

// @Bind #deptTree.onDataRowClick
!function(self,arg,dsOperation) {
var dropDown = dorado.widget.DropDown.findDropDown(self);
var node = self.get("currentNode");
var operation = dsOperation.getData("#");
operation.set("deptUid", node.get("data").get("deptUid"));
operation.set("dept.deptName", node.get("data").get("deptName"));
dropDown.close();

}

